const fs = require("fs");
const ws = fs.createWriteStream("a.txt", "utf-8");
ws.write("Hello, ");
ws.write("World!\n");
ws.end();
ws.on("finish", () => {
  console.log("All writes are now complete.");
});
